package com.comparator.comparator2;

import java.util.Comparator;

public class Employee implements Comparable<Employee> {

	private int empId;
	private String empName;
	private String joiningDate;
	
	public Employee(int empId, String empName, String joiningDate) {
		super();
		this.empId = empId;
		this.empName = empName;
		this.joiningDate = joiningDate;
	}



	public int getEmpId() {
		return empId;
	}



	public void setEmpId(int empId) {
		this.empId = empId;
	}



	public String getEmpName() {
		return empName;
	}



	public void setEmpName(String empName) {
		this.empName = empName;
	}



	public String getJoiningDate() {
		return joiningDate;
	}



	public void setJoiningDate(String joiningDate) {
		this.joiningDate = joiningDate;
	}



	public int compareTo(Employee o) {
		
		return 0;
	}
	//sort by EmpName
	public static Comparator<Employee> compName=new Comparator<Employee>() {

		public int compare(Employee o1, Employee o2) {
			String emp1=o1.getEmpName().toUpperCase();
			String emp2=o2.getEmpName().toUpperCase();
			
			return emp1.compareToIgnoreCase(emp2);
		}
		
	};

}
